package com.csea.common.domain.dos;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.csea.common.domain.handler.JsonArrayTypeHandler;
import lombok.*;

import java.time.LocalDateTime;
import java.util.List;


@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "public_idiom",autoResultMap = true)
public class PublicIdiomDo {


    // 主键，自增
    @TableId(type = IdType.AUTO)
    private Integer idiomId;

    // 成语
    @TableField("word")
    private String word;

    // 释义，text 类型，非空
    @TableField("meaning")
    private String meaning;

    // 感情色彩，枚举类型
    @TableField("emotional_color")
    private String emotionalColor;

    // 例句，json 类型
    @TableField(value = "examples",typeHandler = JsonArrayTypeHandler.class)
    private List<String> examples;

    // 近义词列表，json 类型
    @TableField(value = "synonyms",typeHandler = JsonArrayTypeHandler.class)
    private List<String> synonyms;

    // 反义词列表，json 类型
    @TableField(value = "antonyms" , typeHandler = JsonArrayTypeHandler.class)
    private List<String> antonyms;

    // 易混淆词分析，json 类型
    @TableField(value = "confusing_word_analysis",typeHandler = JsonArrayTypeHandler.class)
    private List<ConfusingWordAnalysis> confusingWordAnalysis;

    // 使用频率
    @TableField("popularity")
    private Integer popularity;

    // 创建时间
    @TableField("create_time")
    private LocalDateTime createTime;

    // 更新时间
    @TableField("update_time")
    private LocalDateTime updateTime;

}